<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FLAC: Porting Guide for New Versions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FLAC
   &#160;<span id="projectnumber">1.3.4</span>
   </div>
   <div id="projectbrief">Free Lossless Audio Codec</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#groups">Modules</a>  </div>
  <div class="headertitle">
<div class="title">Porting Guide for New Versions</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__porting__1__1__2__to__1__1__3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__porting__1__1__2__to__1__1__3.html">Porting from FLAC 1.1.2 to 1.1.3</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__porting__1__1__3__to__1__1__4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__porting__1__1__3__to__1__1__4.html">Porting from FLAC 1.1.3 to 1.1.4</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__porting__1__1__4__to__1__2__0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__porting__1__1__4__to__1__2__0.html">Porting from FLAC 1.1.4 to 1.2.0</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This module describes differences in the library interfaces from version to version. It assists in the porting of code that uses the libraries to newer versions of FLAC.</p>
<p>One simple facility for making porting easier that has been added in FLAC 1.1.3 is a set of #defines in <code>export.h</code> of each library's includes (e.g. <code><a class="el" href="FLAC_2export_8h.html" title="This module contains #defines and symbols for exporting function calls, and providing version informa...">include/FLAC/export.h</a></code>). The #defines mirror the libraries' <a href="http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning">libtool version numbers</a>, e.g. in libFLAC there are <code>FLAC_API_VERSION_CURRENT</code>, <code>FLAC_API_VERSION_REVISION</code>, and <code>FLAC_API_VERSION_AGE</code>. These can be used to support multiple versions of an API during the transition phase, e.g.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT &lt;= 7</span></div>
<div class="line">  legacy code</div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line">  <span class="keyword">new</span> code</div>
<div class="line"><span class="preprocessor">#endif</span></div>
</div><!-- fragment --><p>The source will work for multiple versions and the legacy code can easily be removed when the transition is complete.</p>
<p>Another available symbol is FLAC_API_SUPPORTS_OGG_FLAC (defined in <a class="el" href="FLAC_2export_8h.html" title="This module contains #defines and symbols for exporting function calls, and providing version informa...">include/FLAC/export.h</a>), which can be used to determine whether or not the library has been compiled with support for Ogg FLAC. This is simpler than trying to call an Ogg init function and catching the error. </p>
</div><!-- contents -->

<hr size="1"/>
<div class="copyright">
	<!-- @@@ oh so hacky -->
	<table>
		<tr>
			<td align="left">
				Copyright (c) 2000-2009  Josh Coalson
				Copyright (c) 2011-2016  Xiph.Org Foundation
			</td>
			<td width="1%" align="right">
				<a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=13478&amp;type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
			</td>
		</tr>
	</table>
</div>
<!-- Copyright (c) 2000-2009  Josh Coalson -->
<!-- Copyright (c) 2011-2016  Xiph.Org Foundation -->
<!-- Permission is granted to copy, distribute and/or modify this document -->
<!-- under the terms of the GNU Free Documentation License, Version 1.1 -->
<!-- or any later version published by the Free Software Foundation; -->
<!-- with no invariant sections. -->
<!-- A copy of the license can be found at http://www.gnu.org/copyleft/fdl.html -->
</body>
</html>
